package PTA.javaA;

import java.util.*;

import java.util.*;
public class ex15 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long seed = sc.nextLong();
        int n = sc.nextInt();
        Random r = new Random();
        r.setSeed(seed);
        int count = 0;
        for (int i=0;i<n;i++) {
            double x = r.nextDouble()*2 - 1;
            double y = r.nextDouble()*2 - 1;
            if ( x*x + y*y <=1) {
                count++;
            }
        }
        System.out.println(4*(double)count/n);

    }
}
